const key = 'authorization'

/**
 * 获取token
 */
export function getAuth() {
  sessionStorage.getItem(key)
}

/**
 * 设置token
 * @param {string} token
 */
export function setAuth(token) {
  sessionStorage.setItem(key, token)
}

/**
 * 删除token
 */
export function removeAuth() {
  sessionStorage.removeItem(key)
}

/**
 * 判断是否登录
 */
export function isLogin() {
  return !!sessionStorage.getItem(key)
}